﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Resources;
using System.Text;
using System.Threading.Tasks;
using Cherish.DynamicProxy.Generate;
using System.IO;

namespace Cherish.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            //ResourceWriter rw = new ResourceWriter("my.resources");
            //rw.AddResource("Sex", "boy");
            //rw.AddResource("File", "E:/123123.txt");
            //rw.Close();
            //Assembly ass = Assembly.GetExecutingAssembly();
            //var info = ass.GetManifestResourceStream("Cherish.Test.test.xml");
            var assemblyName = new AssemblyName("Test");
            var assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndSave);
            var moduleBuilder = assemblyBuilder.DefineDynamicModule("Test.Test");
            var typeBuilder = moduleBuilder.DefineType("MyClass");
            PropertyBuilder propertyBuilder = typeBuilder.DefineProperty("Name", PropertyAttributes.None, typeof(string), null);
            //propertyBuilder.SetSetMethod
            //PropertyInfo pi = typeof(Core.Class1).GetProperty("AA");
            //PropertyBuilder builder = PropertyBuilder;
            //System.Dynamic.ExpandoObject
            //System.Dynamic.SetMemberBinder
        }
    }
}
